
    <div class="layui-input-inline">
        <a class="layui-btn" href="{:url('Carmanage/addcar')}">添加车辆</a>
    </div>

<table class="layui-table" lay-filter="edit-table" lay-data="{method: 'post',loading:'true', url:'{:url('Carmanage/carstatus')}', page:true, id:'idDemo'}" lay-filter="test">
    <thead>
    <tr>
        <th lay-data="{field:'car_plate'}">车牌号</th>
        <th lay-data="{field:'car_name'}">车型</th>
        <th lay-data="{field:'store_name'}">车辆所属公司</th>
        <th lay-data="{toolbar:'#car_who'}">车辆类型</th>
        <th lay-data="{toolbar:'#car_hangup'}">是否挂靠</th>
        <th lay-data="{toolbar:'#car_types'}">状态</th>
        <th lay-data="{toolbar:'#status',width:230,}">是否长期租赁车辆</th>
        <th lay-data="{toolbar:'#info',width:220,}">操作</th>
    </tr>
    </thead>
</table>
    <script type="text/html" id="status">
        {{#  if(d.is_secular == 1){ }}
        是
        {{#  } else if(d.is_secular == 2) { }}
        {{d.start_time}} — {{d.end_time}}
        {{#  } }}
    </script>


<script type="text/html" id="car_types">
    {{#  if(d.car_types == 1){ }}
    待租
    {{#  } else if(d.car_types == 2) { }}
    租凭中（ {{d.company_name}}）
    {{#  } else if(d.car_types == 3) { }}
    维修中
    {{#  } else if(d.car_types == 4) { }}
    自用
    {{#  } else if(d.car_types == 5) { }}
    调拨中
    {{#  } else if(d.car_types == 6) { }}
    停业
    {{#  } }}
</script>
<!--<script type="text/html" id="car_hangup">-->
    <!--{{#  if(d.car_hangup == 1){ }}-->
    <!--<input type="checkbox" name="switch" lay-filter="switchId" checked lay-text="开启|关闭"  lay-skin="switch" data-url="{:url('Carmanage/down')}?car_id={{d.car_id}}">-->
    <!--{{#  } else { }}-->
    <!--<input type="checkbox" name="switch"  lay-filter="switchId"   lay-text="开启|关闭" lay-skin="switch" data-url="{:url('Carmanage/open')}?car_id={{d.car_id}}">-->
    <!--{{#  } }}-->
<!--</script>-->
<script type="text/html" id="car_hangup">
    {{#  if(d.car_hangup == 1){ }}
    是
    {{#  } else { }}
    否
    {{#  } }}
</script>
<script type="text/html" id="car_who">
    {{#  if(d.car_who == 1){ }}
    平台车
    {{#  } else if(d.car_who == 2){ }}
    {{d.store_name}}
    {{#  } else { }}
    私家车
    {{#  } }}
</script>
<script type="text/html" id="info">
    {{#  if(d.is_edit == 1){ }}
            <a class="layui-btn layui-btn-primary layui-btn-xs" href="{:url('Carmanage/updCar')}?car_id={{d.car_id}}">修改</a>
            {{#  if(d.car_types == 1){ }}
            <a class="layui-btn  layui-btn-xs  edit-table ajax-delete delete" data-title="自用" data-msg="确认自用？" href="{:url('Carmanage/updStatus')}?car_id={{d.car_id}}&type=4">自用</a>
            <a class="layui-btn layui-btn-normal layui-btn-xs  edit-table ajax-delete delete" data-title="出租" data-msg="确认出租？" href="{:url('Carmanage/updStatus')}?car_id={{d.car_id}}&type=2">出租</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs  edit-table ajax-delete delete" data-title="停业" data-msg="确认停业？" href="{:url('Carmanage/updStatus')}?car_id={{d.car_id}}&type=6">停业</a>
            {{#  } else if(d.car_types == 2) { }}

            {{#  } else if(d.car_types == 3) { }}

            <a class="layui-btn layui-btn-warm  layui-btn-xs  edit-table ajax-delete delete" data-title="待租" data-msg="确认车辆空闲？" href="{:url('Carmanage/updStatus')}?car_id={{d.car_id}}&type=1">待租</a>
            {{#  } else if(d.car_types == 4) { }}

            <a class="layui-btn layui-btn-warm  layui-btn-xs  edit-table ajax-delete delete" data-title="待租" data-msg="确认车辆空闲？" href="{:url('Carmanage/updStatus')}?car_id={{d.car_id}}&type=1">待租</a>
            {{#  } else if(d.car_types == 5) { }}

            {{#  } else if(d.car_types == 6) { }}

            <a class="layui-btn layui-btn-warm  layui-btn-xs  edit-table ajax-delete delete" data-title="待租" data-msg="确认车辆空闲？" href="{:url('Carmanage/updStatus')}?car_id={{d.car_id}}&type=1">待租</a>
            {{#  } }}
    {{#  } else if(d.is_edit == 2){ }}
    {{#  } }}
</script>

